﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SFXManager : Singleton<SFXManager>
{
    public AudioSource audioSource;
    public AudioClip sfxClip;
    public override void Init()
    {
        base.Init();
        if (!audioSource)
        {
            audioSource = this.gameObject.AddComponent<AudioSource>();
        }
    }
    public void PlaySFX(string clipName)
    {
        if (audioSource != null)
        {
            sfxClip = Resources.Load<AudioClip>("AudioClip/"+clipName);
            AudioManager.Instance.PlaySFX(audioSource, sfxClip);
        }
    }
}
